#pragma once

#include "../umlmodel_global.h"

#include <memory>
#include <vector>

#include "PackageableElement.h"

using std::make_shared;
using std::shared_ptr;
using std::vector;

namespace uml {
class Package;

/// <summary>
/// Type
/// A Type constrains the values represented by a TypedElement.
/// </summary>
class UMLMODEL_EXPORT Type : public PackageableElement {

public: // Constructors and destructors
    explicit Type(const QString& umlType="uml::Type");

public: // JsonSerializable override
    void fromJson(const QJsonObject& json, QStringList& errorList) override;
    void toJson(QJsonObject& json) override;

public: // Methods
    /// <summary>
    /// conformsTo
    /// The query conformsTo() gives true for a Type that conforms to another. By
    /// default, two Types do not conform to each other. This query is intended to be
    /// redefined for specific conformance situations.
    /// </summary>
    virtual bool conformsTo(shared_ptr<Type> other) const;

public: // Properties
    /// <summary>
    /// package getter
    /// Specifies the owning Package of this Type, if any.
    /// </summary>
    shared_ptr<Package> package() const;

    /// <summary>
    /// package setter
    /// Specifies the owning Package of this Type, if any.
    /// </summary>
    void setPackage(shared_ptr<Package> value);

private: // Fields
    /// <summary>
    /// package
    /// Specifies the owning Package of this Type, if any.
    /// </summary>
    shared_ptr<Package> package_;

};

} // namespace uml
